// -----------------------------------------------
// Author:     code34 nicolas_boiteux@yahoo.fr
// Edited by:  Neumatic
// Warcontext: Check if pilot is team member
// -----------------------------------------------

private ["_vehicle","_fuel","_text"];

// Kindofserver 1 = team
if (wckindofserver != 1) exitWith {};

_vehicle = vehicle player;
_fuel = fuel _vehicle;

if ((_vehicle isKindOf "Air") and {(driver _vehicle == player)} and {!((vehicle player) isKindOf "ParachuteBase")}) then {
	if !((name player) in wcinteam) then { 
		player action ["Eject", wcvehicle];
		_vehicle engineOn false;
		wcgarbage = ["Pilot", "Ask to admin to recruit you as team member", "You can not pilot air vehicle", 8] spawn WC_fnc_playerhint;
		_vehicle setFuel 0;
		sleep 1;

		//A3 TODO: setVehicleInit
		_text = format ["this setFuel %1;", _fuel];
		_vehicle setVehicleInit _text;
		processInitCommands

		//wcsetfuel = [_vehicle, _fuel];
		//["wcsetfuel", "client"] call WC_fnc_publicvariable;
	};
};